using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class SessionWithObject : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
          DataTable dataTable = new DataTable();
          dataTable.Columns.Add("ItemID");
          dataTable.Columns.Add("ItemName");
          dataTable.Columns.Add("ItemUnit");
          dataTable.Columns.Add("ItemQuantity");
          dataTable.Columns.Add("ItemPrice");
          DataRow dataRow= dataTable.NewRow();
          dataRow["ItemID"]="101";
          dataRow["ItemName"]="ASP.NET 2.0";
          dataRow["ItemUnit"]="Box";
          dataRow["ItemQuantity"]="1";
          dataRow["ItemPrice"]="100.000";
          dataTable.Rows.Add(dataRow);
          dataRow = dataTable.NewRow();
          dataRow["ItemID"] = "102";
          dataRow["ItemName"] = "ADO.NET 2.0";
          dataRow["ItemUnit"] = "Box";
          dataRow["ItemQuantity"] = "1";
          dataRow["ItemPrice"] = "110.000";
          dataTable.Rows.Add(dataRow);
          dataRow = dataTable.NewRow();
          dataRow["ItemID"] = "103";
          dataRow["ItemName"] = "SQL Server 2005";
          dataRow["ItemUnit"] = "Box";
          dataRow["ItemQuantity"] = "1";
          dataRow["ItemPrice"] = "120.000";
          dataTable.Rows.Add(dataRow);
          Session.Add("cart", dataTable);
          Response.Redirect("GetObjectFromSession.aspx");
    }
}
